<script setup lang="ts">
import Chat from '@/components/chat/Chat.vue'
import { useRoute } from 'vue-router'
import type { Ref } from 'vue'
import { ref, watch } from 'vue'

const route = useRoute()

const chatName: Ref<string> = ref('')

watch(
  () => route.query.name,
  newVal => {
    chatName.value = newVal as string
  },
  { immediate: true }
)
</script>

<template>
  <Chat :name="chatName" :key="chatName">
    <!-- 自定义内容渲染器 -->
    <!--    <template #render-answer-content="{ content }">-->
    <!--      {{ content }}-->
    <!--    </template>-->
  </Chat>
</template>

<style scoped></style>
